//
//  HNSalesManCyleDetailCategoryView.m
//  优学荟管理系统
//
//  Created by edz on 2017/11/9.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "HNSalesManCyleDetailCategoryView.h"

@implementation HNSalesManCyleDetailCategoryView
{
    
    __weak IBOutlet UILabel *_Title;
    __weak IBOutlet UILabel *_Count;
    HNSalesManCycleDetailCatgoryModel *_Model;
    void (^_Complete)(HNSalesManCycleDetailCatgoryModel *Model);
}

+ (instancetype)ConfigCategoryViewWithModel:(HNSalesManCycleDetailCatgoryModel *)Model Complete:(void (^)(HNSalesManCycleDetailCatgoryModel *))Complete {
    
    return [[self alloc] initWithModel:Model Complete:Complete];
}

- (instancetype)initWithModel:(HNSalesManCycleDetailCatgoryModel *)Model Complete:(void (^)(HNSalesManCycleDetailCatgoryModel *Model))Complete {
    
    self = [[NSBundle mainBundle] loadNibNamed:[HNSalesManCyleDetailCategoryView description] owner:nil options:nil][0];
    if (self) {
        
        _Complete = Complete;
        _Model = Model;
        _Title.text = Model.name;
        _Count.text = [Model.count stringValue];
    }
    return self;
}

/** 不知道以后会不会用到点击，先拖出来吧 */                              
- (IBAction)Click:(UIButton *)sender {
    
    _Complete ? _Complete(_Model):nil;
}

@end
